import { Action, ThunkAction } from '@reduxjs/toolkit';
import { RootState } from '@/store/rootReducer';
import actions from '@/store/modules/document/document';

// import api from '@/api/fetch';
// import url from '@/api/url';

export type AppThunk = ThunkAction<void, RootState, unknown, Action<string>>;

export const fetchWorkspaceList = (): AppThunk => (dispatch) => {
  const timer = setTimeout(() => {
    clearTimeout(timer);
    dispatch(actions.syncAdd({ count: 2 }));
  }, 1000);

  // api.fetch(url.fetchWorkspaceList, {})?.then((data: any) => {
  //   dispatch(actions.syncAdd({ count: 2 }));
  // });
};
